package ihistoryApp.dal.controller;

import ihistoryApp.dal.entity.Question;
import ihistoryApp.dal.entity.Story;
import ihistoryApp.dal.mapper.StoryMapper;
import ihistoryApp.request.CompleteRequest;
import ihistoryApp.request.GetStoryRequest;
import ihistoryApp.service.StoryService;
import ihistoryApp.view.CompleteView;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


@RestController
@RequestMapping("/story")
public class StoryController {
    @Autowired
    private StoryService storyService;

    @RequestMapping("/complete")
    public ResponseEntity<CompleteView> complete(@RequestBody CompleteRequest request) {
        return ResponseEntity.ok(storyService.complete(request));
    }

    @RequestMapping("/getQuestionList")
    public ResponseEntity<List<Story>> getQuestionList(@RequestBody GetStoryRequest request) {
        return ResponseEntity.ok(storyService.getStoryList(request));
    }
    @RequestMapping("/getSingleModeQuestion")
    public ResponseEntity<List<Story>> getSingleModeQuestion() {
        return ResponseEntity.ok(storyService.getSingleModeQuestion());
    }
}
